package com.example.freshmenapp;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;

public class StandardWeightActivity extends AppCompatActivity implements View.OnClickListener {
    private RadioGroup rg_gender;
    private RadioButton rb_male;
    private RadioButton rb_famale;
    private Button btn_compute;
    private EditText et_height;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_standard_weight);
        et_height = findViewById(R.id.et_height);
        rg_gender = findViewById(R.id.rg_gender);
        rb_male = findViewById(R.id.rb_male);
        rb_famale = findViewById(R.id.rb_famale);
        btn_compute = findViewById(R.id.btn_compute);

        btn_compute.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        int height;
        String gender;
        Double standardweight;
        height=Integer.parseInt(et_height.getText().toString());
        int checkedRadioButtonId = rg_gender.getCheckedRadioButtonId();
        if (checkedRadioButtonId == R.id.rb_male){
            gender="男";
        }else {
            gender="女";
        }

        if (gender.equals("男")){
            standardweight
        }else {
            standardweight
        }
    }
}